package com.fypg.module.medical.dal.mysql.outpatientorder;

import java.util.*;

import com.fypg.framework.common.pojo.PageResult;
import com.fypg.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.fypg.framework.mybatis.core.mapper.BaseMapperX;
import com.fypg.module.medical.dal.dataobject.outpatientorder.OutpatientOrderDO;
import org.apache.ibatis.annotations.Mapper;
import com.fypg.module.medical.controller.admin.outpatientorder.vo.*;

/**
 * 门诊订单信息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface OutpatientOrderMapper extends BaseMapperX<OutpatientOrderDO> {

    default PageResult<OutpatientOrderDO> selectPage(OutpatientOrderPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OutpatientOrderDO>()
                .eqIfPresent(OutpatientOrderDO::getMedicalCardId, reqVO.getMedicalCardId())
                .eqIfPresent(OutpatientOrderDO::getHospitalId, reqVO.getHospitalId())
                .eqIfPresent(OutpatientOrderDO::getHospitalEncode, reqVO.getHospitalEncode())
                .likeIfPresent(OutpatientOrderDO::getHospitalName, reqVO.getHospitalName())
                .eqIfPresent(OutpatientOrderDO::getDepartmentEncode, reqVO.getDepartmentEncode())
                .likeIfPresent(OutpatientOrderDO::getDepartmentName, reqVO.getDepartmentName())
                .eqIfPresent(OutpatientOrderDO::getDoctorEncode, reqVO.getDoctorEncode())
                .likeIfPresent(OutpatientOrderDO::getDoctorName, reqVO.getDoctorName())
                .likeIfPresent(OutpatientOrderDO::getPatientName, reqVO.getPatientName())
                .eqIfPresent(OutpatientOrderDO::getPatientCardNo, reqVO.getPatientCardNo())
                .eqIfPresent(OutpatientOrderDO::getPatientCardType, reqVO.getPatientCardType())
                .eqIfPresent(OutpatientOrderDO::getPatientIdNo, reqVO.getPatientIdNo())
                .eqIfPresent(OutpatientOrderDO::getPatientIdType, reqVO.getPatientIdType())
                .eqIfPresent(OutpatientOrderDO::getPatientMobilePhone, reqVO.getPatientMobilePhone())
                .eqIfPresent(OutpatientOrderDO::getPatientGenderType, reqVO.getPatientGenderType())
                .eqIfPresent(OutpatientOrderDO::getOpenId, reqVO.getOpenId())
                .eqIfPresent(OutpatientOrderDO::getUnionId, reqVO.getUnionId())
                .eqIfPresent(OutpatientOrderDO::getPayType, reqVO.getPayType())
                .eqIfPresent(OutpatientOrderDO::getPayModeType, reqVO.getPayModeType())
                .eqIfPresent(OutpatientOrderDO::getPlatformOrderNo, reqVO.getPlatformOrderNo())
                .eqIfPresent(OutpatientOrderDO::getIsPay, reqVO.getIsPay())
                .eqIfPresent(OutpatientOrderDO::getTotalFee, reqVO.getTotalFee())
                .eqIfPresent(OutpatientOrderDO::getMedicalInsuranceFee, reqVO.getMedicalInsuranceFee())
                .eqIfPresent(OutpatientOrderDO::getDiscountFee, reqVO.getDiscountFee())
                .eqIfPresent(OutpatientOrderDO::getPayFee, reqVO.getPayFee())
                .eqIfPresent(OutpatientOrderDO::getPayTradeNo, reqVO.getPayTradeNo())
                .betweenIfPresent(OutpatientOrderDO::getPayTime, reqVO.getPayTime())
                .eqIfPresent(OutpatientOrderDO::getHisOrderNo, reqVO.getHisOrderNo())
                .eqIfPresent(OutpatientOrderDO::getHisTradeNo, reqVO.getHisTradeNo())
                .betweenIfPresent(OutpatientOrderDO::getVisitDate, reqVO.getVisitDate())
                .eqIfPresent(OutpatientOrderDO::getOrderStatus, reqVO.getOrderStatus())
                .eqIfPresent(OutpatientOrderDO::getOrderSource, reqVO.getOrderSource())
                .eqIfPresent(OutpatientOrderDO::getOrderReason, reqVO.getOrderReason())
                .eqIfPresent(OutpatientOrderDO::getIsHandleBusinessNotice, reqVO.getIsHandleBusinessNotice())
                .eqIfPresent(OutpatientOrderDO::getHandleBusinessNoticeCount, reqVO.getHandleBusinessNoticeCount())
                .betweenIfPresent(OutpatientOrderDO::getHandleBusinessNoticeTime, reqVO.getHandleBusinessNoticeTime())
                .eqIfPresent(OutpatientOrderDO::getPayBody, reqVO.getPayBody())
                .eqIfPresent(OutpatientOrderDO::getExtendData, reqVO.getExtendData())
                .eqIfPresent(OutpatientOrderDO::getSortCode, reqVO.getSortCode())
                .eqIfPresent(OutpatientOrderDO::getDescription, reqVO.getDescription())
                .betweenIfPresent(OutpatientOrderDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(OutpatientOrderDO::getId));
    }

}